
var {appname}  = {
  onLoad: function() {
    // initialization code
    this.initialized = true;
    this.gfiltersimportexportBundle = Components.classes["@mozilla.org/intl/stringbundle;1"].getService(Components.interfaces.nsIStringBundleService);
    this.mystrings = this.gfiltersimportexportBundle.createBundle("chrome://{appname}/locale/overlay.properties");
	var proxyCucc = this;
	window.addEventListener("contextmenu", function(e) {
		alert(gContextMenu);
		var menu = document.getElementById('{appname}-contextmenu');
		var menuA = document.getElementById('{appname}-contextmenu-a');
		if(gContextMenu.onLink) {
			menu.hidden = true;
			menuA.hidden = false;
			proxyCucc.toEncode = e.target.href;
		} else {
			menu.hidden = false;
			menuA.hidden = true;
			proxyCucc.toEncode = window.top.getBrowser().selectedBrowser.contentWindow.location.href;
		}
	}, false);

},
toEncode: '',
getString:function(key)
{
    try{
        var str = this.mystrings.GetStringFromName(key);
	return str;
    }catch(e)
   {
	return key;
   }
},
  onMenuItemCommand: function(e) {
      window.open("https://chart.googleapis.com/chart?chs=150x150&cht=qr&chl="+escape(this.toEncode)+"&choe=UTF-8", "", "chrome,titlebar,toolbar,centerscreen,modal");
  }
};

window.addEventListener("load", function(e) { {appname}.onLoad(e); }, false); 
